package net.ipinglun.util;

import java.util.Date;

public class CacheBean {

    protected long cacheTime = 0;
    protected long periodTime = 86400000; //缓存有效期 毫秒单位


    public Boolean isExpired() {

        if (new Date().getTime() - cacheTime > periodTime) {
            return false;
        }

        return true;
    }

    public void setCacheTime() {
        cacheTime = new Date().getTime();
    }

    public void setCacheTime(long cacheTime) {
        this.cacheTime = cacheTime;
    }

    public void setPeriodTime(long periodTime) {
        this.periodTime = periodTime;
    }
}
